home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Virushunter / Virus Checker / Install_Virus_Checker next >
Text File  |  1996-09-26  |  12KB  |  462 lines

  1. ; $VER: Virus_Checker Install 7.18 (26.9.95)
  2. ; Script to install Virus_Checker
  3. ; Written by Simon Dick of Amigaholics Club (sidick@essex.ac.uk)
  4. ; Updated and enhanced by John Veldthuis
  5.  
  6. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7. ;;;
  8. ;;; Get the version and revision number of file/device/library/OS/etc
  9. ;;;
  10. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  11. ;
  12. ; INPUTS: Item    ; Name of device/file/library/etc. "" for OS version
  13. ;
  14. ; OUTPUTS: VerN        ; (long) version/revision number
  15. ;          Ver        ; Version number
  16. ;          Rev        ; Revision number
  17. ; NOTE: Both Ver and Rev returned as 0 if "WV_Item" does not exist
  18. ;
  19. (procedure WhatVersion
  20.     (
  21.     (if (= VerN "")
  22.         (set VerNum (getversion))        ; For OS
  23.         (set VerNum (getversion VerN)))    ; For other "files"
  24.     (set Ver (/ VerNum 65536))
  25.     (set Rev (- VerNum (* Ver 65536)))
  26.     )
  27. )
  28.  
  29.  
  30. ;Set env var Virus_Checker_Path to installed place
  31. (procedure setVCEnv
  32.     (
  33.     (set VCPath (expandpath @default-dest))
  34.     (set VCPathS (cat 
  35.             ("setenv Virus_Checker_Path \"%s\"\n" VCPath)
  36.             ("copy env:Virus_Checker_Path envarc: quiet\n")
  37.              )
  38.     )
  39.     (textfile 
  40.         (dest "T:VCEnvSet")
  41.         (append VCPathS)
  42.     )
  43.     (execute "T:VCEnvSet")
  44.     (delete "T:VCEnvSet")
  45.     )
  46. )
  47.  
  48. (set @app-name "Virus_Checker")
  49.  
  50. (complete 0)
  51.  
  52. ;(if (= @language "deutsch")
  53. ;  (
  54. ;    ; Add the german strings here for example
  55. ;    (set where_vc "Please put the german strings in here first!"
  56. ;    )
  57. ;  )
  58. ;)
  59.  
  60. (if (= @language "english")
  61.   (
  62.     (set whatinstall (cat "Do you want a full installation of Virus Checker "
  63.                           "or just a partial one?"
  64.                      )
  65.     )
  66.  
  67.  
  68.     (set fullinstall "Full Install")
  69.     (set partialinstall "Partial Install")
  70.     (set installhelp (cat "Full install installs ALL Virus Checker files to "
  71.             "the directory chosen, while partial install just installs the "
  72.                           "program files where needed"
  73.                      )
  74.     )
  75.     (set where_vc (cat "Please select directory to put Virus_Checker in"
  76.                   )
  77.     )
  78.     (set copyingdir    "Copying Virus_Checker drawer")
  79.  
  80.     (set copybblib     "Copying Bootblock.library")
  81.     (set copybbfile    "Copying Bootblock.brainfile")
  82.     (set copyunpacklib "Copying unpack.library")
  83.     (set copyxfdlib    "Copying xfdmaster.library")
  84.     (set copybguilib    "Copying bgui.library")
  85.     (set copyxfddecrs  "Copying XFD external decrunchers, please choose which ones to install")
  86.     (set copyvcbrain   "Copying VirusChecker.brain")
  87.     (set copyvcprog    "Copying Virus_Checker")
  88.     (set instaloverold "Virus_Checker being installed in WBStartup over old version")
  89.     (set vcrunfrom     "Where do you want to run Virus_Checker from?")
  90.     (set bestplace     "The best place is from the User-Startup")
  91.     (set cantinstalloverdir "You can't install Virus Checker over an existing directory")
  92.     (set removebrain  (cat "I have found version %ld.%ld of the VirusChecker.brain "
  93.                        "file in L:\n"
  94.                        "This is only needed if you're running Virus_Checker "
  95.                        "from WBStartup.\n"
  96.                        "Shall I delete it?"
  97.                       )
  98.     )
  99.     (set deletebrain   "Deleting L:VirusChecker.brain")
  100.     (set installguide  "Do you want to install the online AmigaGuide help file?")
  101.     (set copyingguide  "Copying Virus_Checker.guide")
  102.     (set whichlangs (cat "Which Virus Checker locale catalogs do you want "
  103.                          "to install?")
  104.     )
  105.     (set langhelp (cat "Copying these files will allow Virus_Checker to be "
  106.                        "run using different Locales under Workbench 2.1 or "
  107.                        "higher. Just select the catalog files which you "
  108.                        "will need to use.")
  109.     )
  110.     (set adddat        "I need to add the following line to your \s:User-Startup\ file\n\n%s")
  111.     (set copycat       "Copying Virus_Checker.catalog")
  112.     (set needtoreset   "You will need to reset to cause VirusChecker to be run")
  113.     (set instlrexx     "Do you want to install the Virus Checker ARexx scripts?")
  114.     (set copyrexx      "Which ARexx scripts do you want to copy?")
  115.   )
  116. )
  117.  
  118. (welcome)
  119.  
  120. (set VerN "")
  121. (WhatVersion)        ;Get version
  122. (if (< Ver 37)
  123.     (abort (cat #ver_err1 #err_msg))
  124. )
  125.  
  126.  
  127. ;If installed already then use that one
  128. (if (= (exists "ENV:Virus_Checker_Path" (noreq)) 1)
  129.     (set @default-dest (getenv "Virus_Checker_Path"))
  130. )
  131.  
  132. (set fullinstall (askbool (default 1)
  133.                           (prompt whatinstall)
  134.                           (help installhelp)
  135.                           (choices fullinstall partialinstall)
  136.                  )
  137. )
  138.  
  139. (if fullinstall
  140.   (
  141.     (set @default-dest
  142.       (askdir (prompt where_vc)
  143.               (help @askdir-help)
  144.               (default @default-dest)
  145.       )
  146.     )
  147.  
  148.     (complete 10)
  149.  
  150.     ; Copy Virus_Checker drawer
  151.     (copylib (prompt copyingdir)
  152.              (help @copylib-help)
  153.              (source "Virus_Checker")
  154.              (dest @default-dest)
  155.              (infos)
  156.              (optional oknodelete force)
  157.     )
  158.     (copylib (prompt copyingdir)
  159.              (help @copylib-help)
  160.              (source "VirusChecker.brain")
  161.              (dest @default-dest)
  162.              (optional oknodelete askuser)
  163.     )
  164.     (copylib (prompt copyingdir)
  165.              (help @copylib-help)
  166.              (source "Virus_Checker.guide")
  167.              (dest @default-dest)
  168.              (infos)
  169.              (optional nofail askuser)
  170.     )
  171.     (copyfiles (prompt copyingdir)
  172.                (help @copyfiles-help)
  173.                (source "NZ_VC.bsh")
  174.                (dest @default-dest)
  175.                (optional nofail askuser)
  176.     )
  177.     (copylib (prompt copyingdir)
  178.              (help @copylib-help)
  179.              (source "MakeKey")
  180.              (dest @default-dest)
  181.              (infos)
  182.              (optional nofail askuser)
  183.     )
  184.   )
  185.   ; If partial install
  186.   (
  187. (debug "")    
  188.   )
  189. )
  190. (complete 20)
  191.  
  192. ; Install libraries
  193.  
  194. (copylib (prompt copybblib)
  195.          (help @copylib-help)
  196.          (source "libs/Bootblock.library")
  197.          (dest "LIBS:")
  198.          (optional nofail askuser)
  199. )
  200.  
  201. (complete 30)
  202.  
  203. (copylib (prompt copybbfile)
  204.          (help @copylib-help)
  205.          (source "l/Bootblock.brainfile")
  206.          (dest "L:")
  207.          (optional nofail askuser)
  208. )
  209.  
  210. (complete 40)
  211.  
  212. (copylib (prompt copyunpacklib)
  213.          (help @copylib-help)
  214.          (source "libs/unpack.library")
  215.          (dest "LIBS:")
  216.          (optional nofail askuser)
  217. )
  218.  
  219. (complete 50)
  220.  
  221. (copylib (prompt copyxfdlib)
  222.          (help @copylib-help)
  223.          (source "libs/xfdmaster.library")
  224.          (dest "LIBS:")
  225.          (optional nofail askuser)
  226. )
  227.  
  228. (copylib (prompt copybguilib)
  229.          (help @copylib-help)
  230.          (source "libs/bgui.library")
  231.          (dest "LIBS:")
  232.          (optional nofail askuser)
  233. )
  234.  
  235. (complete 60)
  236.  
  237. (copyfiles (prompt copyxfddecrs)
  238.            (help @copyfiles-help)
  239.            (source "libs/xfd")
  240.            (dest "LIBS:xfd")
  241.            (optional nofail askuser)
  242.            (confirm)
  243.            (all)
  244. )
  245.  
  246. (complete 70)
  247.  
  248. ; Check if brainfile is in L:
  249. (set brainfile (exists "L:VirusChecker.brain"))
  250.  
  251. (set wherestart (exists "SYS:WBStartup/Virus_Checker"))
  252.  
  253. (if (= wherestart 0)
  254.   (set wherestart (askchoice (prompt vcrunfrom)
  255.                              (help bestplace)
  256.                              (default 0)
  257.                              (choices "User-Startup" "WBStartup" "None")
  258.                   )
  259.        
  260.   )
  261.   (
  262.     (if (= wherestart 1)
  263.       (message instaloverold)
  264.       (abort cantinstalloverdir)
  265.     )
  266.   )
  267. )
  268.  
  269. (if (= wherestart 0)
  270.   (
  271.     (if (= fullinstall 0)
  272.       (
  273.         (if (exists (tackon @default-dest "Utilities"))
  274.           (set @default-dest (tackon @default-dest "Utilities"))
  275.           (if (exists "SYS:Utilities")
  276.             (set @default-dest (expandpath "SYS:Utilities"))
  277.           )
  278.         )
  279.         (set @default-dest (askdir (prompt "")
  280.                                    (help @askdir-help)
  281.                                    (default @default-dest)
  282.                            )
  283.         )
  284.         (copylib (prompt copyvcprog)
  285.                  (help @copylib-help)
  286.                  (source "Virus_Checker")
  287.                  (dest @default-dest)
  288.                  (infos)
  289.                  (optional oknodelete force)
  290.         )
  291.         (copylib (prompt copyvcbrain)
  292.                  (help @copylib-help)
  293.                  (source "VirusChecker.brain")
  294.                  (dest @default-dest)
  295.                  (optional nofail askuser)
  296.         )
  297.       )
  298.     )
  299.   )
  300. )
  301.  
  302. (if (= wherestart 1)
  303.   (
  304.     (copylib (prompt copyvcbrain)
  305.              (help @copylib-help)
  306.              (source "VirusChecker.brain")
  307.              (dest "L:")
  308.              (optional nofail askuser)
  309.     )
  310.     (copylib (prompt copyvcprog)
  311.              (set @default-dest "SYS:WBStartup")
  312.              (help @copylib-help)
  313.              (source "Virus_Checker")
  314.              (dest "SYS:WBStartup")
  315.              (optional oknodelete force)
  316.              (infos)
  317.     )
  318.   )
  319.   (
  320.     (if (= brainfile 1)
  321.       (
  322.     (set VerN "L:VirusChecker.brain")
  323.     (WhatVersion)        ;Get version
  324.         (set rembrain (askbool (prompt (removebrain Ver Rev))
  325.                                (help @askbool-help)
  326.                                (default 1)
  327.                       )
  328.         )
  329.         (if (= rembrain 1)
  330.           (delete ("L:VirusChecker.brain")
  331.                   (optional force)
  332.           )
  333.         )
  334.       )
  335.     )
  336.     (if (= wherestartup 0) ; User-Startup
  337.       (
  338.     (set cmd (tackon @default-dest "Virus_Checker"))
  339.         (startup @app-name (prompt (adddat cmd))
  340.                            (help @startup-help)
  341.                            (command cmd)
  342.         )
  343.       )
  344.     )
  345.   )
  346. )
  347.  
  348. (complete 80)
  349.  
  350. (if (askbool (prompt installguide)
  351.              (help @askbool-help)
  352.              (default 1)
  353.     )
  354.   (
  355.     (copylib (prompt copyingguide)
  356.              (help @copylib-help)
  357.              (source "Virus_Checker.guide")
  358.          (dest "HELP:")
  359. ;             (dest (cat "HELP:" @language))  Later
  360.              (optional nofail force)
  361.     )
  362.   )
  363. )
  364.  
  365. (complete 90)
  366.  
  367. (set localever (/ (getversion "locale.library" (resident)) 65536))
  368.  
  369. ;(if (>= (/ (getversion "locale.library" (resident)) 65536) 38))
  370. (if (>= localever 38)
  371.   (
  372.     (set locales (askoptions (prompt whichlangs)
  373.                              (help langhelp)
  374.                              (choices "nederlands"
  375.                                       "svenska"
  376.                     "italiano"
  377.                     "deutsch"
  378.                     "français"
  379.                   )
  380.                  )
  381.     )
  382.   )
  383. )
  384. (if (IN locales 0)
  385.   (
  386.     (copylib (prompt copycat)
  387.              (help @copylib-help)
  388.              (source "catalogs/nederlands/Virus_Checker.catalog")
  389.              (dest "LOCALE:Catalogs/nederlands")
  390.              (optional nofail askuser)
  391.     )
  392.   )
  393. )
  394. (if (IN locales 1)
  395.   (
  396.     (copylib (prompt copycat)
  397.              (help @copylib-help)
  398.              (source "catalogs/svenska/Virus_Checker.catalog")
  399.              (dest "LOCALE:Catalogs/svenska")
  400.              (optional nofail askuser)
  401.     )
  402.   )
  403. )
  404.  
  405. (if (IN locales 2)
  406.   (
  407.     (copylib (prompt copycat)
  408.              (help @copylib-help)
  409.              (source "catalogs/italiano/Virus_Checker.catalog")
  410.              (dest "LOCALE:Catalogs/italiano")
  411.              (optional nofail askuser)
  412.     )
  413.   )
  414. )
  415.  
  416. (if (IN locales 3)
  417.   (
  418.     (copylib (prompt copycat)
  419.              (help @copylib-help)
  420.              (source "catalogs/deutsch/Virus_Checker.catalog")
  421.              (dest "LOCALE:Catalogs/deutsch")
  422.              (optional nofail askuser)
  423.     )
  424.   )
  425. )
  426.  
  427. (if (IN locales 4)
  428.   (
  429.     (copylib (prompt copycat)
  430.              (help @copylib-help)
  431.              (source "catalogs/français/Virus_Checker.catalog")
  432.              (dest "LOCALE:Catalogs/français")
  433.              (optional nofail askuser)
  434.     )
  435.   )
  436. )
  437.  
  438. (set installrexx (askbool (prompt instlrexx)
  439.                           (help @askbool-help)
  440.                           (default 1)
  441.                  )
  442. )
  443.  
  444. (if installrexx
  445.   (copyfiles (prompt copyrexx)
  446.              (help @copyfiles-help)
  447.              (source "ARexx")
  448.              (dest "REXX:")
  449.              (all)
  450.              (optional nofail askuser)
  451.              (confirm)
  452.   )
  453. )
  454.  
  455. (setVCEnv)
  456. (complete 100)
  457.  
  458. (if (= wherestartup 2)
  459.   (exit)
  460.   (exit needtoreset)
  461. )
  462.